//所有服务器基类
const ws = require("ws");
const queue = require('queue');
class Server{
    constructor(options){
        this.name='服务器';
        this.protocolType='ws';
        this.protocol=null;
        this.port=6001;
        this.rpcProtocolType='ws';
        this.rpcProtocol=null;
        this.rpcPort=7001;
        !!options&&Object.assign(this,options);
        this.start();
    }
    //开始监听服务器
    start(){
        let Protocol=require(`../protocol/${this.protocolType}`);
        this.protocol=new Protocol({port:this.port});
        this.rpcProtocol=new Protocol({port:this.rpcPort})
    }
}

module.exports=Server;